<script language="javascript">
   
    $(document).ready(function() {
	
    //Moi khoi dong
    	$.ajax({  
                type: "POST", 
				url: 'home/load_product_category/laptop_product/all_product', 
                complete: function(data){  
				        $('#content').html(data.responseText);
                }   
        });
        
        //tab ngang
        
             // put all your jQuery goodness in here.
    $(".tabs li:first").attr("id","current"); // Activate first tab
    $('.tabs li').click(function(e) {
		e.preventDefault();
		$(".tabs li").attr("id",""); //Reset id's
		$(this).attr("id","current"); // Activate this
		var tabngang = $(this).attr('class');
        var tabdung = $('.htab #current').attr('class');
		$.ajax({  
                type: "POST", 
				url: 'home/load_product_category/'+tabdung+'/'+tabngang, 
                complete: function(data){  
				$('#content').html(data.responseText);
                }  
            });  

    });
    
    //tabdung
     $(".htab li:first").attr("id","current"); // Activate first tab
     $('.htab li').click(function(e) {
		e.preventDefault();
		$(".htab li").attr("id",""); //Reset id's
		$(this).attr("id","current"); // Activate this
		var tabdung = $(this).attr('class');
        var tabngang = $('.tabs #current').attr('class');
		$.ajax({  
                type: "POST", 
				url: 'home/load_product_category/'+tabdung+'/'+tabngang, 
                complete: function(data){  
				$('#content').html(data.responseText);
                
                }  
            });
             

    });
        //biet binh
		
        

		$(".ajax").colorbox();

		$(".iframe").colorbox({iframe:true, width:"80%", height:"90%", bottom:"0px"});
        $(".iframe").colorbox({fixed:true});

		$(".inline").colorbox({inline:true, width:"50%"});

		$(".callbacks").colorbox({

			onOpen:function(){ alert('onOpen: colorbox is about to open'); },

			onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },

			onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },

			onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },

			onClosed:function(){ alert('onClosed: colorbox has completely closed'); }

		});

		

		//Example of preserving a JavaScript event for inline calls.

		$("#click").click(function(){ 

			$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");

			return false;

		});
    
    });//document ready
    
    //them san pham so sanh
     
    //addproduct
    var addProduct = function(id){
    //alert(id);
        var url = '<?php echo base_url(); ?>compare/addproduct/'+id;
        //alert(url);
        //var getData;
        $.ajax({
                type: 'GET',
                url: url,
	  	        dataType: 'JSON',
                success: function(data){
                    if(data.kq=='false')
                    {
                       $('#compare-div').html(data.name);
                    }
                    else
                    {
                       //alert(data.kq);
                       $('#compare-div').append(data.name);
                    }
                }
            });
}
</script>
<div id="top"></div>
<div id="mid"></div>
<div id="bottom"></div>